***************************************************************
***** BANKS' MARKET POWER, ACCESS TO FINANCE, AND LEVERAGE
*****         M.C. Bustamante and F. D'Acunto
***************************************************************


*** This .do file produces the results reported in the Figures and Tables of the 
*** empirical analysis part of the paper "Banks' Market Power, Access to Finance, 
*** and Leverage" by M. C. Bustamante and F. D'Acunto


*** The micro data from the Kauffman Firm Survey is proprietary and access is
*** maintained and allowed by NORC at the University of Chicago


clear all
set more off


global path    ""   /// [insert data folder path here]


*** FIGURE 1

use "${path}Bustamante_DAcunto_Pseudo_Data.dta", clear

** Left panel
forvalues i=1(1) 4{
  sum has_bank_debt if lend_mkt_concentration==`i'
}

** Right panel
forvalues i=1(1) 4{
  sum leverage if has_bank_debt==1 & lend_mkt_concentration==`i'
}


*** FIGURE 2

use "${path}Bustamante_DAcunto_Pseudo_Data.dta", clear

** Left panel
forvalues i=1(1) 4{
  sum has_bank_debt if year==2004 & lend_mkt_concentration==`i'
}

** Right panel
forvalues i=1(1) 4{
  sum zero_debt if lend_mkt_concentration==`i'
}



*** FIGURE 3

use "${path}Bustamante_DAcunto_Pseudo_Data.dta", clear

** Left panel
forvalues i=1(1) 4{
  sum leverage if has_bank_debt==1 & year==2004 & lend_mkt_concentration==`i'
}

** Right panel
forvalues i=1(1) 4{
  sum log_debt if lend_mkt_concentration==`i'
}



*** TABLE 1

global initial_char leverage_first age_first net_worth5 fss education top4_4
global time_var_char leverage roa size sh_owner

** Panel A

use "${path}Bustamante_DAcunto_Pseudo_Data.dta", clear

sum $initial_char $time_var_char 


foreach vv in leverage_first age_first net_worth5 fss education lend_mkt_concentration /*
  */  leverage roa size sh_owner {
   xtile `vv'4=`vv', nq(4)
   }
   
foreach vv in leverage_first age_first net_worth5 fss education lend_mkt_concentration /*
  */  leverage roa size sh_owner {
   sum `vv' if `vv'4==2
   sum `vv' if `vv'4==3
   }


** Panel B

use "${path}Bustamante_DAcunto_Pseudo_Data.dta", clear

pwcorr $initial_char, obs sig



*** TABLE 2

use "${path}Bustamante_DAcunto_Pseudo_Data.dta", clear

reg leverage i.lend_mkt_concentration, vce(cluster naics2_year)
areg leverage i.lend_mkt_concentration, abs(naics2) vce(cluster naics2_year)
areg leverage i.lend_mkt_concentration i.year, abs(naics2) vce(cluster naics2_year)

reg has_bank_debt i.lend_mkt_concentration, vce(cluster naics2_year)
areg has_bank_debt i.lend_mkt_concentration, abs(naics2) vce(cluster naics2_year)
areg has_bank_debt i.lend_mkt_concentration i.year, abs(naics2) vce(cluster naics2_year)



*** TABLE 3

use "${path}Bustamante_DAcunto_Pseudo_Data.dta", clear

global base_controls i.net_worth5 i.education  
global det_first_lev size size_first sh_owner i.fss5 i.top4_4


reg roa lev_first_h_lend_con high_lend_concentration leverage_first, vce(cluster naics2_year)
areg roa lev_first_h_lend_con high_lend_concentration leverage_first, abs(naics2) vce(cluster naics2_year)
areg roa lev_first_h_lend_con high_lend_concentration leverage_firs i.year, abs(naics2) vce(cluster naics2_year)
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $base_controls i.year, abs(naics2) vce(cluster naics2_year)
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $base_controls $det_first_lev i.year, abs(naics2) vce(cluster naics2_year)
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $base_controls $det_first_lev , abs(naics2_year) vce(cluster naics2_year)



*** TABLE 4
 
use "${path}Bustamante_DAcunto_Pseudo_Data.dta", clear

global dem_controls i.net_worth5 i.education  
global firm_controls size size_first sh_owner i.fss5 

* Cols 1-2
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls i.state, abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $dem_controls $firm_controls i.state, abs(naics2_year) vce(cluster naics2_year)

* Cols 3-4
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls if (year!=2008 & year!=2009), abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $dem_controls $firm_controls if (year!=2008 & year!=2009), abs(naics2_year) vce(cluster naics2_year)

* Cols 5-6
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls if high_tech==0, abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $dem_controls $firm_controls  if high_tech==0, abs(naics2_year) vce(cluster naics2_year)



*** TABLE 5

use "${path}Bustamante_DAcunto_Pseudo_Data.dta", clear

global dem_controls i.net_worth5 i.education  
global firm_controls size size_first sh_owner i.fss5 


* Col 1
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls if ip==1, abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $dem_controls $firm_controls if ip==1, abs(naics2_year) vce(cluster naics2_year)

* Col 2
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls if ip==0, abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $dem_controls $firm_controls if ip==0, abs(naics2_year) vce(cluster naics2_year)

* Col 3
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls if online==1, abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $dem_controls $firm_controls if online==1, abs(naics2_year) vce(cluster naics2_year)

* Col 4
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls if online==0, abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $base_controls $firm_controls if online==0, abs(naics2_year) vce(cluster naics2_year)

* Col 5
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls if high_inf_asym==1, abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $base_controls $firm_controls if high_inf_asym==1, abs(naics2_year) vce(cluster naics2_year)

* Col 6
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls if high_inf_asym==0, abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $base_controls $firm_controls if high_inf_asym==0, abs(naics2_year) vce(cluster naics2_year)

* Col 7
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls if single_own==1, abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $base_controls $firm_controls if single_own==1, abs(naics2_year) vce(cluster naics2_year)

* Col 8
areg roa lev_first_h_lend_con high_lend_concentration leverage_first $dem_controls $firm_controls if single_own==0, abs(naics2_year) vce(cluster naics2_year)
areg roa bank_debt_f_high_lend_con high_lend_concentration bank_debt_first $base_controls $firm_controls if single_own==0, abs(naics2_year) vce(cluster naics2_year)









